D:\git\skunkworks\herald-for-cpp\herald\src\datatype\distance.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright 2021 Herald Project Contributors |
2 | | // SPDX-License-Identifier: Apache-2.0 |
3 | | // |
4 | | |
5 | | #include "herald/datatype/distance.h" |
6 | | |
7 | | #include <functional> |
8 | | |
9 | | namespace herald { |
10 | | namespace datatype { |
11 | | |
12 | | Distance::Distance() : value(0.0) |
13 | 450 | { |
14 | 450 | ; |
15 | 450 | } |
16 | | |
17 | | Distance::Distance(double value) : value(value) |
18 | 8 | { |
19 | 8 | ; |
20 | 8 | } |
21 | | |
22 | | Distance::Distance(const Distance& other) |
23 | | : value(other.value) |
24 | 74 | { |
25 | 74 | ; |
26 | 74 | } |
27 | | |
28 | | Distance::Distance(Distance&& other) |
29 | | : value(other.value) |
30 | 600 | { |
31 | 600 | ; |
32 | 600 | } |
33 | | |
34 | 1.13k | Distance::~Distance() = default; |
35 | | |
36 | | Distance& |
37 | | Distance::operator=(const Distance& other) |
38 | 24 | { |
39 | 24 | value = other.value; |
40 | 24 | return *this; |
41 | 24 | } |
42 | | |
43 | | Distance& |
44 | | Distance::operator=(Distance&& other) |
45 | 600 | { |
46 | 600 | value = other.value; |
47 | 600 | return *this; |
48 | 600 | } |
49 | | |
50 | | std::size_t |
51 | 0 | Distance::hashCode() const noexcept { |
52 | 0 | return std::hash<double>{}(value); |
53 | 0 | } |
54 | | |
55 | 0 | Distance::operator double() const noexcept { |
56 | 0 | return value; |
57 | 0 | } |
58 | | |
59 | | |
60 | | |
61 | | bool |
62 | | Distance::operator==(const double other) const noexcept |
63 | 0 | { |
64 | 0 | return value == other; |
65 | 0 | } |
66 | | |
67 | | bool |
68 | | Distance::operator!=(const double other) const noexcept |
69 | 7 | { |
70 | 7 | return value != other; |
71 | 7 | } |
72 | | |
73 | | bool |
74 | | Distance::operator==(const Distance& other) const noexcept |
75 | 0 | { |
76 | 0 | return value == other.value; |
77 | 0 | } |
78 | | |
79 | | bool |
80 | | Distance::operator!=(const Distance& other) const noexcept |
81 | 0 | { |
82 | 0 | return value != other.value; |
83 | 0 | } |
84 | | |
85 | | bool |
86 | | Distance::operator<(const Distance& other) const noexcept |
87 | 0 | { |
88 | 0 | return value < other.value; |
89 | 0 | } |
90 | | |
91 | | bool |
92 | | Distance::operator<=(const Distance& other) const noexcept |
93 | 0 | { |
94 | 0 | return value <= other.value; |
95 | 0 | } |
96 | | |
97 | | bool |
98 | | Distance::operator>(const Distance& other) const noexcept |
99 | 0 | { |
100 | 0 | return value > other.value; |
101 | 0 | } |
102 | | |
103 | | bool |
104 | | Distance::operator>=(const Distance& other) const noexcept |
105 | 0 | { |
106 | 0 | return value >= other.value; |
107 | 0 | } |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
113 | | } // end namespace |
114 | | } // end namespace |